#pragma once

#include "GameState.h"
#include "Map.h"
#include "Point.h"
#include <list>
#include <vector>
#include "MenuButton.h"
#include "Sprite.h"
#include "Animation.h"
#include "Map.h"
#include "Player.h"
#include "Item.h"
#include "Enemy.h"
#include "GhostEnemy.h"
#include "HpPacmana.h"
#include "GhostManager.h"



class PlayState : public GameState
{
public:

	PlayState();
	virtual ~PlayState(){};

	virtual void update();
	virtual void render();
	virtual void hangdler();

	virtual bool init();
	virtual bool exit();


	bool checkCollisionBox(SDL_Rect objectImageFirs, SDL_Rect objectImageTwo);
	bool checkCollisionSquare(cSquare &objectImageFirs, cSquare &objectImageTwo);
	bool checkPixelBased(std::vector<SDL_Rect> &A, std::vector<SDL_Rect> &B);

	bool getPaueStatus() { return m_bPause; }
	virtual void setPauseState(int &a)
	{
		if (a == 1)
			m_bPause = true;
		else
			m_bPause = false;
	}

	void addCreep();
	void addWater();

	virtual std::string getStateID() const;

protected:
private:

	static bool m_bPause;

	MenuButton* m_pauseObject;
	static void m_pause();

	Sprite m_sprite_play_state;
	Sprite m_sprite_item;

	Player* m_pacman;
	Ghost* m_ghost;
	std::list<GhostEnemy*> mGhostEnemy;
	std::list<HpPacman*> mHpPacman;
	Item* _item;
	std::list<EnemyManager*> mEnemyGhost;
	std::list<Item*> m_item;
	// private method
	SDL_Window* m_pWindow;


	Map* m_map;
	static const std::string s_playID;
	float timeGenarateCreep; // time creat -> creep
};